#!/usr/bin/env python  
#coding=utf-8


#使字典的所有的value都为0
def setDicValuesZero(dic):
  for dickey in dic.keys():
      dic.update({dickey:0})
  return dic
  
adic = {'a':3, 'b':34, 'c':12}

adic = setDicValuesZero(adic)

print adic








#import urllib2, urllib, re, os, time
#import sqlite3
#from BeautifulSoup import BeautifulSoup
#
###函数
##解析页面函数
##getpage
#def getPage(url):
#  page = urllib2.urlopen(url) 
#  soup = BeautifulSoup(page) 
#  return soup
#  
##去掉HTML标签
#def dropTags(soupStr):
#  soupStr = str(soupStr)
#  soupStr = re.compile('<[^>]+>').sub("",soupStr)
#  return re.compile('豆瓣').sub("",soupStr)
#  
###Begin！
##设置当前目录为工作目录
#os.chdir(os.path.dirname(__file__))
#
##数据库连接
#conn = sqlite3.connect('doubanMoviesDB.db')
#curs = conn.cursor()
#
#subjectId = 3754946
#
#movieName = '锦衣卫'
#
#description = '明朝末年，皇帝昏庸，曾保家卫国屡建功勋的锦衣卫被奸佞利用，\
#沦为暗杀工具，令世人闻风丧胆。因谋权篡位而被施以刖刑的庆亲王（洪金\
#宝 饰）虽被流放塞北多年，然野心不死，暗中勾结大太监贾精忠（罗家英 饰）\
#，企图卷土重来。贾精忠在中土掀起一场腥风血雨，不愿苟从者格杀勿论。锦衣\
#卫指挥史青龙（甄子丹 饰）在执行任务过程中因发现贾精忠阴谋而被追杀，身受\
#重创后委身正义镖局以图保护玉玺。茫茫大漠，青龙在镖头之女乔花（赵薇 饰）以及\
#天鹰帮帮主大漠判官（吴尊 饰）的帮助下准备阻止庆亲王与贾精忠的阴谋，此时，庆亲\
#王义女——拥有绝世武功的脱脱（徐子珊 饰）身负追杀青龙的使命亦赶至雁门关……'
#
#query = "insert into movies(name,subjectid,description) values ('"+ movieName +"','" + str(subjectId) +"','"+ description +"')"
#
#curs.execute(query)
#conn.commit()
#conn.close()


#豆瓣电影网址
#webUrl = 'http://movie.douban.com/subject/'
#
##http://movie.douban.com/subject/3731581/
#############4707585
#subjectId = 3754946
#
#while subjectId <= 9999999:
#  
#  subjectUrl = 'http://movie.douban.com/subject/'+str(subjectId)
#
#  subjectSoup = getPage(subjectUrl)
#
#  h1Span = subjectSoup.find('span', {'property':'v:itemreviewed'})
#
#  movieName = h1Span.string
#
#  print movieName
#
#  if subjectSoup.find('span', {'class':'all hidden'}):
#    soupStr = str(subjectSoup.find('span', {'class':'all hidden'}))
#    description = dropTags(soupStr)
#    print description
#    
#  else:
#    soupStr = str(subjectSoup.find('span', {'property':'v:summary'}))
#    description = dropTags(soupStr)
#    print description
#  
#  query ="insert into "
#  
#  subjectId += 1




##数据库连接
#conn = sqlite3.connect('doubanMoviesDB.db')
#curs = conn.cursor()
#
#query = ""
#
#c.execute(query)


##创建表格
#c.execute('''create table stocks (date text, trans text, symbol text,  qty real, price real)''')
# 
## 插入数据，执行SQL语句
#c.execute("""insert into stocks
#          values ('2006-01-15','BUoY','RHATd',100,35.14)""")  
# 
##将变动保存到数据库文件，如果没有执行词语句，则前面的insert 语句操作不会被保存
#conn.commit()
# 
##得到所有的记录
#rec = c.execute('''select * from stocks''')
#print c.fetchall()

